package com.hz.email.service.impl;

import com.hz.email.dao.TEmailDao;
import com.hz.email.entity.TEmail;
import com.hz.email.service.EmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.UUID;

@Service(value = "EmailServiceImpl1")
public class EmailServiceImpl implements EmailService {
    @Resource
    private TEmailDao tEmailDao;

    @Override
    public int addEmail(TEmail tEmail) {
        tEmail.setId(UUID.randomUUID().toString());
        tEmail.setCreateTime(new Date());
        tEmail.setUpdateTime(new Date());
        return tEmailDao.addEmail(tEmail);
    }

    @Override
    public List<TEmail> findIn(TEmail tEmail) {
        return tEmailDao.findIn(tEmail);
    }
}
